package com.neteast.androidclient.contact.domain;

import java.io.Serializable;

import android.util.Log;

import com.neteast.androidclient.contact.Constant;


public class ContactData implements Comparable<ContactData>,Serializable,Cloneable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 5475171262495082676L;
	//用于服务器
	public int id;
	public String label;
	public String content;
	public int modified=Constant.CONTACT_NEW;
	public int mimeTypeId;

	@Override
	public String toString() {
		return "ContactData [id=" + id + ", label=" + label + ", content="
				+ content + ", modified="+ modified + ", mimeTypeId=" + mimeTypeId + "]";
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ContactData other = (ContactData) obj;
		if (content == null) {
			if (other.content != null)
				return false;
		} else if (!content.equals(other.content))
			return false;
		if (label == null) {
			if (other.label != null)
				return false;
		} else if (!label.equals(other.label))
			return false;
		return true;
	}

	@Override
	public ContactData clone(){
		try {
			ContactData data = (ContactData) super.clone();
			return data;
		} catch (CloneNotSupportedException e) {
			Log.e("test", e.getMessage(),e);
			throw new RuntimeException("对象克隆失败");
		}
	}

	public int compareTo(ContactData another) {
		return id-another.id;
	}
}
